<template>
    <div class="goods-desc">
        <h2 class="goods-desc-title">{{ descinfo.title }}</h2>
        <hr>
        <div class="goods-desc-content" v-html="descinfo.content"></div>
    </div>
</template>

<script>
import {Toast} from 'mint-ui'
export default {
    data(){
        return {
            id:this.$route.params.id,
            descinfo:{}
        }
    },
    created(){
        this.getGoodsDesc()
    },
    methods:{
        getGoodsDesc(){
            this.$http.get('api/goods/getdesc/' + this.id ).then(result=>{
                if(result.body.status === 0){
                    this.descinfo = result.body.message[0]
                }else{
                    Toast('获取数据失败!')
                }
            })
        }
    }
}
</script>

<style lang="scss">
    .goods-desc{
        .goods-desc-title{
            text-align: center;
            font-size:18px;
            padding: 20px 0;
            color:#67c2e0;
        }
        .goods-desc-content{
            img{
                width:100%;
            }
        }
    }
</style>